package band.wukong.practice.dubbo.quickstart;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * @author wukong(wukonggg@139.com)
 */
public class EchoServiceConsumer {

    private static final Logger logger = LoggerFactory.getLogger(EchoServiceConsumer.class);

    static {
        System.setProperty("dubbo.application.logger","slf4j");
    }

    public static void main(String[] args) {
        final String[] LOCATION = new String[]{"META-INF/spring/**/*.xml"};
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(LOCATION);

        context.start();
        EchoService echoService = (EchoService) context.getBean("echoService");

        logger.info(echoService.echo("悟空wukong"));
        logger.info("Press any key to exit.");

        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
